<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>过滤选择器-表单对象属性</title>
<script type="text/javascript" src="js/jquery-1.5.js"></script>
<script type="text/javascript">
	$(function() {
		//1.:enabled 匹配所有可用元素
		$("input:enabled").val("OK");
		//2.:disabled 匹配所有不可用元素
		$("input:disabled").val("disabled");
		//3:checked 匹配所有选中的被选中元素(复选框、单选框等，不包括select中的option)
		$("input:checked").attr("disabled","disabled");
		//4:selected 匹配所有选中的option元素
		$("select option:selected").css("backgroundColor","lightGrey");
	});
</script>
</head>
<body>
<form>
  <input name="email" disabled="disabled" />
  <input name="id" />
  
  <input type="checkbox" name="newsletter" checked="checked" value="Daily" />
  <input type="checkbox" name="newsletter" value="Weekly" />
  <input type="checkbox" name="newsletter" checked="checked" value="Monthly" />
<select>
  <option value="1">Flowers</option>
  <option value="2" selected="selected">Gardens</option>
  <option value="3">Trees</option>
</select>
</form>
</body>
</html>